﻿using DocumentFormat.OpenXml.Lite.DrawingML.Chart.Elements;
using DocumentFormat.OpenXml.Lite.DrawingML.Chart.Properties;
using DocumentFormat.OpenXml.Lite.DrawingML.Geometry.Properties;
using DocumentFormat.OpenXml.Lite.DrawingML.Text;
using DocumentFormat.OpenXml.Lite.DrawingML.Text.Properties;
using DocumentFormat.OpenXml.Lite.DrawingML.Transformation;
using DocumentFormat.OpenXml.Lite.DrawingML.Types;
using DocumentFormat.OpenXml.Lite.Shared;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.DrawingML.Chart.Axes
{
    [XmlRoot("dateAx", Namespace = Constants.Chart)]
    public class DateAxis : XmlSerializable, IAxis
    {
        [XmlElement("axId", Namespace = Constants.Chart)]
        public RequiredValue<int> AxisId { get; set; }

        [XmlElement("scaling", Namespace = Constants.Chart)]
        public Scaling Scaling { get; set; }

        [Optional]
        [XmlElement("delete", Namespace = Constants.Chart)]
        public NullableValue<bool> Delete { get; set; }

        [XmlElement("axPos", Namespace = Constants.Chart)]
        public RequiredValue<ST_AxPos> AxisPosition { get; set; }

        [Optional]
        [XmlElement("majorGridlines", Namespace = Constants.Chart)]
        public Gridlines MajorGridlines { get; set; }

        [Optional]
        [XmlElement("minorGridlines", Namespace = Constants.Chart)]
        public Gridlines MinorGridlines { get; set; }

        [Optional]
        [XmlElement("title", Namespace = Constants.Chart)]
        public Title Title { get; set; }

        [Optional]
        [XmlElement("numFmt", Namespace = Constants.Chart)]
        public NumberFormat NumberFormat { get; set; }

        [Optional]
        [XmlElement("majorTickMark", Namespace = Constants.Chart)]
        public NullableValue<ST_TickMark> MajorTickMark { get; set; }

        [Optional]
        [XmlElement("minorTickMark", Namespace = Constants.Chart)]
        public NullableValue<ST_TickMark> MinorTickMark { get; set; }

        [Optional]
        [XmlElement("tickLblPos", Namespace = Constants.Chart)]
        public NullableValue<ST_TickLblPos> TickLabelPosition { get; set; }

        [Optional]
        [XmlElement("spPr", Namespace = Constants.Chart)]
        public ShapeProperties ShapeProperties { get; set; }

        [Optional]
        [XmlElement("txPr", Namespace = Constants.Chart)]
        public TextProperties TextProperties { get; set; }

        [XmlElement("crossAx", Namespace = Constants.Chart)]
        public RequiredValue<uint> CrossAxesId { get; set; }

        [Optional]
        [XmlElement("", Namespace = Constants.Chart)]
        public IAxesCrossElement Crosses { get; set; }

        [Optional]
        [XmlElement("auto", Namespace = Constants.Chart)]
        public NullableValue<bool> Auto { get; set; }
        
        [Optional]
        [XmlElement("lblOffset", Namespace = Constants.Chart)]
        public NullableValue<uint> LabelOffset { get; set; }

        [Optional]
        [XmlElement("baseTimeUnit", Namespace = Constants.Chart)]
        public NullableValue<ST_TimeUnit> BaseTimeUnit { get; set; }

        [Optional]
        [XmlElement("majorUnit", Namespace = Constants.Chart)]
        public RequiredValue<double> MajorUnit { get; set; }

        [Optional]
        [XmlElement("majorTimeUnit", Namespace = Constants.Chart)]
        public NullableValue<ST_TimeUnit> MajorTimeUnit { get; set; }

        [Optional]
        [XmlElement("minorUnit", Namespace = Constants.Chart)]
        public RequiredValue<double> MinorUnit { get; set; }

        [Optional]
        [XmlElement("minorTimeUnit", Namespace = Constants.Chart)]
        public NullableValue<ST_TimeUnit> MinorTimeUnit { get; set; }

        [Optional]
        [XmlElement("extLst", Namespace = Constants.Chart)]
        public ExtensionList ExtensionList { get; set; }

        public DateAxis() { }
    }
}
